package de.lusiardi.webdav.xml;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * http://www.webdav.org/specs/rfc4918.html#ELEMENT_owner
 *
 * @author Joachim Lusiardi
 */
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Owner {

    @XmlAnyElement(lax = true)
    private List<Object> owners;

    public List<Object> getOwners() {
        return owners;
    }

    public void setOwners(List<Object> owners) {
        this.owners = owners;
    }

    public void addOwner(Object owner) {
        if (owners == null) {
            owners = new ArrayList<Object>();
        }
        owners.add(owner);
    }
}
